<% preview_row_id    = SecureRandom.uuid.to_s.gsub(/\-/, "_") %>
<% preview_tag_id    = SecureRandom.uuid.to_s.gsub(/\-/, "_") %>
<span class="icon icon-magnifier" onclick="<%= "$.ajax({url:'#{view_attachment_inline_path(attachment.id, preview_tag_id)}', type: 'post'}); $('##{preview_row_id}').toggle();".html_safe %>"></span>
<table id="<%= preview_row_id %>" style="display:none;" width="<%= json_escape(Setting['plugin_redmine_preview_inline']['size']).presence || "300" %>">
  <tbody>
	<tr>
	  <td class="box" style="text-align:left;">
		<span class="icon icon-close" onclick="<%= "$('##{preview_row_id}').hide(); $('##{preview_tag_id}').html('');".html_safe %>"></span>
		<br>
		<div id="<%= preview_tag_id %>" style="width:100%;"></div>
	  </td>
	</tr>
  </tbody>
</table>